import request from '@/utils/request'

// 保存日报的基本信息
export const saveDailyReportBasic = (data) => {
  return request({
    url: '/v1/report/daily/basic/',
    method: 'post',
    data,
  })
}

// 查询日报的基本信息
export const getDailyReportBasic = (params) => {
  return request({
    url: '/v1/report/daily/basic/',
    method: 'get',
    params,
  })
}

// 新建日报的类别
export const saveDailyReportCateogy = (data) => {
  return request({
    url: '/v1/report/daily/category/',
    method: 'post',
    data,
  })
}

// 获取类别及其指标
export const getDailyReportCategoy = (params) => {
  return request({
    url: '/v1/report/daily/category/',
    method: 'get',
    params,
  })
}

// 保存编辑的类别下指标
export const saveDailyReportIndex = (data) => {
  return request({
    url: '/v1/report/daily/category/index/',
    method: 'post',
    data,
  })
}

// 保存编辑的日报消息
export const saveDailyReportMessage = (data) => {
  return request({
    url: '/v1/report/daily/category/message/',
    method: 'post',
    data,
  })
}

// 删除一个大类
export const deleteDailyReportCategory = (data) => {
  return request({
    url: '/v1/report/daily/category/',
    method: 'delete',
    data,
  })
}

// 删除大类内的指标
export const deleteDailyReportIndex = (data) => {
  return request({
    url: '/v1/report/daily/category/index/',
    method: 'delete',
    data,
  })
}

// 日报导出excel
export const exportDailyReportAsExcel = (data) => {
  return request({
    url: '/v1/report/daily/exportExcel/',
    method: 'post',
    data
  })
}

// 日报导出pdf
export const exportDailyReportAsPdf = (data) => {
  return request({
    url: '/v1/report/daily/exportPdf/',
    method: 'post',
    data,
  })
}
